package com.coder4j.mapper;

import com.coder4j.starter.mybatis.BaseMapper;
import com.coder4j.entity.STaskFlowDetailEntity;
import com.coder4j.vo.SControlDetailVO;
import com.coder4j.vo.SDisplayInterfaceDetailVO;
import com.coder4j.vo.STaskFlowDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * 任务流程详情
 * @author keller
 * @date 2025-03-18 16:22:26
 */
@Mapper
public interface STaskFlowDetailMapper extends BaseMapper<STaskFlowDetailEntity>{
	/**
     * 默认查询条件
     * @return
     */
    @Override
    default List<String> defaultCondition(){
    return Arrays.asList(
			" <if test = 'taskFlowId!=null'> task_flow_id=#{taskFlowId} </if>",
            " <if test = 'createId!=null'> AND create_id=#{createId} </if>",
            " <if test = 'updateId!=null'> AND update_id=#{updateId} </if>");
    }

    List<Map<String, Object>> selectListForAllLabelByTaskFlowId(@Param("taskFlowId") Integer taskFlowId);

    List<STaskFlowDetailEntity> getByTaskFlowId(@Param("id")Integer id);

    List<SDisplayInterfaceDetailVO> getListByTaskDetailIds(@Param("ids")List<Integer> ids);

    List<SControlDetailVO> getControl(@Param("controlId")Integer controlId);

    Integer getDisPlayByTaskId(@Param("id")Integer id);

    List<STaskFlowDetailVO> moduleById(@Param("id")Integer id);

    List<SDisplayInterfaceDetailVO> getDisPlayName(@Param("displayId")Integer displayId);
}
